package cn.psvmc.cxzapi.mapper.order;

import cn.psvmc.cxzapi.config.mybatisplus.mapper.MyBaseMapper;
import cn.psvmc.cxzapi.model.common.OrderEntity;
import cn.psvmc.cxzapi.model.order.TOrderDelivery;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 订单快递表 Mapper 接口
 * @Author auto
 * @Date 2024-08-12
 */
public interface TOrderDeliveryMapper extends MyBaseMapper<TOrderDelivery> {

    //发货工作台
    IPage<Map> listAll(Page<TOrderDelivery> iPage,@Param("entity") OrderEntity entity);

    //校验订单号
    List<TOrderDelivery> checkOrderCode(@Param("list") List<TOrderDelivery> list);

    //根据订单号查询发货信息
    Map<String, Object> findByOrderCode(@Param("orderCode") String orderCode, @Param("type") Integer type);

    //根据快递单号查询订单快递id
    List<TOrderDelivery> listOdIdByTrackingCode(@Param("deliveryType") int deliveryType, @Param("trackingCode") String trackingCode);

    //根据订单号和类型查询订单快递id
    TOrderDelivery findByCodeAndType(@Param("orderCode") String orderCode, @Param("type") Integer type);

    //获取租期未固定订单列表
    List<TOrderDelivery> listOrder(@Param("deliveryType") int deliveryType);

    //获取发货工作台状态数量
    Map<String, Object> getStatusNum(@Param("entity") OrderEntity entity);

    //查询订单发货信息
    TOrderDelivery findByOrderIdAndType(@Param("orderId") Integer orderId, @Param("type") Integer type);
}
